package no.sachmuld.methodcombination.examples.performance.reflection;

import no.sachmuld.methodcombination.api.BehaviourChain;
import no.sachmuld.methodcombination.api.reflection.Standard;
import no.sachmuld.methodcombination.api.reflection.component.MethodCombination;
import no.sachmuld.methodcombination.examples.performance.FooBehaviour;
import no.sachmuld.methodcombination.examples.performance.Step;

import java.util.List;

/**
 *
 */
public abstract class Foo implements no.sachmuld.methodcombination.examples.performance.Foo {

    private BehaviourChain<FooBehaviour> chain = new BehaviourChain<>();
    protected List<Step> trace;

    public void setTrace(List<Step> trace) {
        this.trace = trace;
    }

    private static MethodCombination bar = new Standard<Void>().build(FooBehaviour.class, Foo.class, "bar", Integer.TYPE);

    @Override
    final public void bar(int i) {
        bar.execute(this, chain, i);
    }

    final protected Foo with(FooBehaviour... fooBehaviours) {
        chain.addAll(fooBehaviours);
        return this;
    }



}
